<template>
	<view>
		<!-- <uni-collapse>
			<uni-collapse-item class="one" v-for="(item,index) in collapseData" :key="index" :title="item.academy">
				<uni-collapse v-for="(classItem,classIndex) in item.class" :key="classIndex" >
					<uni-collapse-item class="two" :title="classItem.name">
						<view class="three" v-for="(subItem,subIndex) in classItem.students" :key="subIndex" @click="itemClick(subItem.studentNum)">
							<view class="three-title">{{subItem.name}}</view>
							<image class="three-more" src="../../../static/report/report_more.png"></image>
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</uni-collapse-item>
		</uni-collapse> -->
		<uni-collapse>
			<uni-collapse-item class="one" v-for="(item,index) in collapseData" :key="index" :title="item.parent">
				<view class="three" v-for="(subItem,subIndex) in item.children" :key="subIndex" @click="itemClick(subItem.id)">
					<view class="three-title">{{subItem.name}}</view>
					<image class="three-more" src="/static/report/report_more.png"></image>
				</view>
			</uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	import {
		isEmpty
	} from '@/utils/index.js'
	import uniCollapse from './CustomCollapse/uni-collapse/uni-collapse.vue';
	import uniCollapseItem from './CustomCollapse/uni-collapse-item/uni-collapse-item.vue';
	export default {
		components: {
			uniCollapse,
			uniCollapseItem
		},
		props:{
			collapseData:{
				type:Array,
				default(){
					return []
				}
			}
		},
		methods: {
			itemClick(id){
				this.$emit('itemClick',id);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.one{
		box-shadow: 0 4upx 20upx 0 rgba(153, 153, 153, 0.15);
		border-radius: 8upx;
		border: solid 2upx #f7f7f7;
		margin: 20upx 0;
	}

	.two {
		color: #333333;
		font-size: 24upx;
		line-height: 64upx;
		padding: 0 20upx;
	}
	.three{
		display: flex;
		line-height: 64upx;
		padding: 0 50upx;
		&-title {
			flex: 1;
			color: #333333;
			font-size: 24upx;
		}
		
		&-more {
			width: 24upx;
			height: 24upx;
			margin-top: 12upx;
		}
	}
</style>
